package com.googlecode.intellimars.mrsp.tableview.column;

import com.intellij.util.ui.ColumnInfo;
import jp.sourceforge.mrsp.model.Artifact;

import java.util.Comparator;

public class RepositoryUrl extends ColumnInfo<Artifact, String> {
    public RepositoryUrl() {
        super("repository");
    }

    public String valueOf(Artifact artifact) {
        return artifact.getRepoUrl();
    }

    public String getPreferredStringValue() {
        return "12345678901234567890";
    }

    public Comparator<Artifact> getComparator() {
        return new Comparator<Artifact>() {
            public int compare(Artifact o1, Artifact o2) {
                return o1.getRepoUrl().compareTo(o2.getRepoUrl());
            }
        };
    }
}